package com.htfyun.fragment.settings;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.htfyun.fragment.library.LibraryImageFragment;
import com.htfyun.fragment.library.LibraryLocalBookFileFragment;

/**
 * Created by sst on 2017/11/24.
 */

public class SettingsMainPagerFragmentAdapter extends FragmentPagerAdapter {

    private String[] mTitles;

    public SettingsMainPagerFragmentAdapter(FragmentManager fm, String... titles) {
        super(fm);
        mTitles = titles;
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 0) {
            return SettingsWifiFragment.newInstance();
        } else {
            return SettingsAboutFragment.newInstance();
        }
    }

    @Override
    public int getCount() {
        return mTitles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }
   
}
